package com.example.smartcity.ui.person.login

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.example.smartcity.logic.Repository
import com.example.smartcity.logic.model.FeedBack
import com.example.smartcity.logic.model.FeedBackAll

/**
 *
 *  ANDROID STUDIO -version 2022.19
 *  项目名: FeedBackActivityViewModel
 *  创建时间: 2023/2/14 22:34
 *  CodeAuthor: ikun
 *  email: 2506789532@qq.com
 **/
class FeedBackActivityViewModel : ViewModel() {
    // 存储反馈列表数据
    private val feedbackData = MutableLiveData<String>()
    val feedbackList = ArrayList<FeedBackAll.Rows>()
    val feedbackDataLIve = Transformations.switchMap(feedbackData){ query ->
        Repository.getFeedBackAll(query)
    }
    fun feedback(token: String){
        feedbackData.value = token
    }
}